{# src/Blogger/BlogBundle/Resources/views/Page/index.html.twig #}
{% extends 'ArticleClientBundle::articleLayout.html.twig' %}

{% block body %}
    {% for article in pagination %}
        <article class="blog">
            <div class="date"><time datetime="{{ article.createdAt|date('c') }}">{{ article.createdAt|date('l, F j, Y') }}</time></div>
            <header>
                <h2><a href="{{ path('article_client_article_show', { 'id': article.id, 'slug': article.slug }) }}">{{ article.title }}</a></h2>
            </header>

{#             <img src="{{ asset(['images/', article.image]|join) }}" />#}
            <div class="snippet">
                <p>{{ article.content(500) }}</p>
                <p class="continue"><a href="{{ path('article_client_article_show', { 'id': article.id, 'slug': article.slug }) }}">Continue reading...</a></p>
            </div>

            <footer class="meta">
                <p>Comments: <a href="{{ path('article_client_article_show', { 'id': article.id, 'slug': article.slug }) }}#comments">{{ article.comments|length }}</a></p>
                <p>Posted by <span class="highlight">{{article.author.userName}}</span> at {{ article.createdAt|date('h:iA') }}</p>
                
            </footer>
        </article>
    {% else %}
        <p>There are no blog entries for symblog</p>
    {% endfor %}
    	{# display navigation #}
		<div class="navigation" id="paging_navigation">
		    {{ knp_pagination_render(pagination) }}
		</div>
{% endblock %}